<template>
  <card class="reset-card">
    <template #header>
      <BillTemplateHeader
        ref="BillTemplateHeader"
        @add="addEvent"
      />
    </template>
    <template #filter>
      <BillTemplateFilterTool
        ref="BillTemplateFilterTool"
        @search="searchEvent($event)"
      />
    </template>
    <BillTemplateTableArea
      ref="BillTemplateTableArea"
      @edit="editEvent($event)"
      @mobileSet="mobileSetEvent($event)"
    />
    <BillTemplateDialog
      ref="BillTemplateDialog"
      @refresh="refreshEvent"
    />
    <MobileSetting ref="MobileSetting" @refresh="refreshEvent" />

  </card>
</template>
<script>
import BillTemplateHeader from './components/BillTemplateHeader'
import BillTemplateFilterTool from './components/BillTemplateFilterTool'
import BillTemplateTableArea from './components/BillTemplateTableArea'
import BillTemplateDialog from './components/BillTemplateDialog'
import MobileSetting from './components/MobileSetting'
export default {
  name: 'BillTemplate',
  components: {
    BillTemplateHeader,
    BillTemplateFilterTool,
    BillTemplateTableArea,
    BillTemplateDialog,
    MobileSetting
  },
  data() {
    return {}
  },
  methods: {
    // 查询列表
    searchEvent(searchForm) {
      this.$refs.BillTemplateTableArea.query(searchForm)
    },
    // 新增
    addEvent() {
      this.$refs.BillTemplateDialog.pageType = 'add'
      this.$refs.BillTemplateDialog.show()
    },
    // 编辑
    editEvent(row) {
      this.$refs.BillTemplateDialog.pageType = 'edit'
      this.$refs.BillTemplateDialog.findById(row.lngbilltemplateid)
      this.$refs.BillTemplateDialog.show()
    },
    // 查看
    mobileSetEvent(row) {
      this.$refs.MobileSetting.show()
      this.$refs.MobileSetting.lngtemplateid = row.lngbilltemplateid
      this.$refs.MobileSetting.getFields(row.lngreceipttypeid)
      this.$refs.MobileSetting.content = row.strmessage
    },
    // 刷新
    refreshEvent() {
      this.$refs.BillTemplateTableArea.queryListByPage()
    }
  }
}
</script>
<style scoped>
.reset-card{
  overflow: hidden;
}
</style>
